#include <stdio.h>

int gcd(int a, int b)
{
	if (b == 0) return a;
	else return gcd(b, a%b);
}

int main(int argc, char *argv[])
{
	int n, a[50], t;
	int i, j;

	scanf("%d", &n);
	for (i=0; i<n; i++) {
		scanf("%d", &a[i]);
	}

	t = a[0];
	for (i=1; i<n; i++) {
		t = gcd(t, a[i]);
	}

	printf("%d\n", t);

	return 0;
}
